package com.housing.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.housing.domain.RentalConfig;
import com.housing.domain.vo.RentalConfigVo;
import com.zmetaport.common.core.utils.MapstructUtils;
import com.zmetaport.common.mybatis.core.mapper.BaseMapperX;

import java.util.List;

/**
 * 【请填写功能名称】Mapper接口
 *
 * @author chensm
 * @date 2024-12-15
 */
public interface RentalConfigMapper extends BaseMapperX<RentalConfig, RentalConfigVo> {

    default RentalConfigVo queryBySource(Long sourceId, Integer type){
        return this.selectVoOne(new LambdaQueryWrapper<RentalConfig>().eq(RentalConfig::getSourceId, sourceId).eq(RentalConfig::getType, type));
    }

    default List<RentalConfigVo> queryBySources(List<Long> sourceId, Integer type){
        return this.selectVoList(new LambdaQueryWrapper<RentalConfig>().in(RentalConfig::getSourceId, sourceId).eq(RentalConfig::getType, type));
    }

}
